﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NMigrate;
using System.Web.Security;

namespace $safeprojectname$
{
	public class CreateUsers : IExecutable
	{
		#region IExecutable Members

		public void Execute(Configuration args)
		{
			SqlMembershipProviderFactory factory = new SqlMembershipProviderFactory();
			factory.SetLowSecurity();
			factory.ConnectionString = args.GetValue<Environment>().Database.FullConnectionString;
			
			var success = factory.CreateMembershipProvider().CreateUser("TestUser", "password");
			if(success != MembershipCreateStatus.Success)
				throw new Exception("Unexpected result when creating test user " + success.ToString());
		}

		#endregion
	}

}
